package com.aiti.lulian.mapper;

import com.aiti.base.core.base.mapper.SuperMapper;
import com.aiti.lulian.dto.EnterpriseSelectDto;
import com.aiti.lulian.dto.LuLianEnterpriseOperationDto;
import com.aiti.lulian.dto.newCard.EnterpriseMiniVersionDto;
import com.aiti.lulian.entity.LuLianCgsOrder;
import com.aiti.lulian.entity.LuLianEnterprise;
import com.aiti.lulian.entity.LuLianEnterprisePlantImg;
import com.aiti.lulian.vo.EnterpriseAdminUserVo;
import com.aiti.lulian.vo.EnterpriseOpenCardInfo;
import com.aiti.lulian.vo.LuLianEnterpriseOperationVo;
import com.aiti.lulian.vo.LuLianEnterpriseVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author ZhouS
 * @CreateDate 2022-05-25
 * @Description:
 */
@Repository
public interface LuLianEnterpriseMapper extends SuperMapper<LuLianEnterprise> {


    List<LuLianEnterprisePlantImg> getPlantImg(String enterpriseId);

    Page<LuLianEnterprise> queryPage(Page<Object> page, @Param("enterpriseSelectDto") EnterpriseSelectDto enterpriseSelectDto);

    List<LuLianCgsOrder> findActivityOrderByBaseId(String baseId);

    LuLianEnterprise selectByBaseId(String enterpriseId);

    Map getByUserId(String userId);


    String selectUserBindEnterpriseName(@Param("userId") String userId);

    List<LuLianEnterpriseOperationVo> selectEnterpriseList(@Param("dto") LuLianEnterpriseOperationDto luLianEnterpriseOperationDto, Page<LuLianEnterprise> page);

    // 前一天企业开通名片的企业和企业用户数
    List<EnterpriseOpenCardInfo> selectEnterpriseOpenCardUserCount(@Param("startTime")String startTime, @Param("endTime")String endTime);

    List<EnterpriseAdminUserVo> cardAdminUser(String enterpriseId);

    List<String> selectUsers(@Param("type") String type);

    EnterpriseMiniVersionDto queryMiniVersion(@Param("enterpriseName") String enterpriseName);

    void updateEnterpriseMiniVersion(@Param("baseId") String baseId, @Param("miniProgramVersion") Integer miniProgramVersion, @Param("expireTime") Date expireTime);

    Integer queryEnterpriseUserCount(@Param("enterpriseId") String enterpriseId, @Param("userId") String userId);

    Integer queryEnterpriseAdminCount(@Param("userId") String userId, @Param("enterpriseId")String enterpriseId);

    List<String> queryEnterpriseAdminUserIdList(@Param("enterpriseId") String enterpriseId);

    LuLianEnterpriseVo selectEnterpriseInfoById(@Param("enterpriseId") String enterpriseId);

    void updateEnterpriseMainProducts(@Param("enterpriseId")String enterpriseId, @Param("mainProducts")String mainProducts);
}